<!-- 简历管理 -->
<template>
	<view class="page">
		<!-- 顶部导航栏 -->
		<view class="tabbar">
			<view class="tabbar-title flex justify-center align-center" :style="{'paddingTop': tabbarTop}">
				<view class="icon" @click="back">
					<image src="https://sanfuzhide.oss-cn-hangzhou.aliyuncs.com/circle/linkbank.png" mode=""></image>
				</view>
				<view class="title flex justify-center align-center">
					简历管理
				</view>
			</view>
			<!-- 卡片区域 -->
			<view class="card">
				<view class="top flex">
					<view class="icon">

					</view>
					<view class="name">
						投递信息
					</view>
				</view>
				<view class="item flex justify-between align-center">
					<view class="child flex justify-center align-center flex-column"  @click="linklist(0)">
						<view class="num">
							{{item.preliminaryScreening}}
						</view>
						<view class="text">
							初筛
						</view>
					</view>
					<view class="child flex justify-center align-center flex-column" @click="linklist(1)">
						<view class="num">
							{{item.underEvaluation}}
						</view>
						<view class="text">
							评估中
						</view>
					</view>
					<view class="child flex justify-center align-center flex-column" @click="linklist(2)">
						<view class="num">
							{{item.toBeInterviewed}}
						</view>
						<view class="text">
							待面试
						</view>
					</view>
					<view class="child flex justify-center align-center flex-column" @click="linklist(4)">
						<view class="num">
							{{item.offer}}
						</view>
						<view class="text">
							offer
						</view>
					</view>
					<view class="child flex justify-center align-center flex-column" @click="linklist(5)">
						<view class="num">
							{{item.onBoarding}}
						</view>
						<view class="text">
							入职
						</view>
					</view>
					
				</view>
				<view class="img flex justify-center align-center">
					<image src="https://sanfuzhide.oss-cn-hangzhou.aliyuncs.com/my/activity3.png" mode=""></image>
				</view>
			</view>
		</view>
		<view style="height: 135rpx; width: 100%;">

		</view>
		<!-- 内容区域 -->
		<view class="content" style="height: calc(100vh - 425rpx - 140rpx - env(safe-area-inset-bottom));">
			<scroll-view scroll-y="true"
				style="height: calc(100vh - 80rpx - 425rpx - 140rpx - env(safe-area-inset-bottom));">
				<!-- 在线简历 -->
				<view class="resume">
					<view class="items flex align-center">
						<view class="icon">

						</view>
						<view class="title flex">
							我的在线简历
						</view>
					</view>
					<OnlineResume :titleName="titleName[0]"  :it="it" >
					</OnlineResume>
					<view class="con text-ellipsis2">
						{{it.resumeAscendancy}}
					</view>
					<view class="u-lineop">

					</view>
					<OnlineResume :titleName="titleName[1]">
						<view class="tree" v-for="item in it.userResumeJobPostsList" :key="item.jobPostsId" @click="link0(item)">
							<view class="top flex align-center">
								<view class="left">
									{{item.jobPostsName}}
								</view>
								<view class="right">
									{{item.jobLower}}-{{item.jobUpper}}
								</view>
							</view>
							<view class="bot flex align-center">
								<view class="left">
									{{item.jobCity}}
								</view>
								<view class="right">
									{{item.jobIndustry}}
								</view>
							</view>
						</view>
					</OnlineResume>
					<view class="u-lineop">

					</view>
					<OnlineResume :titleName="titleName[2]">
						<view class="work" v-for="item in it.userResumeWorkExperienceList" :key="item.jobId" @click="link1(item)">
							<view class="company flex justify-between align-center">
								<view class="name">
									{{item.companyName}}
								</view>
								<view class="date">
									{{gettimer(item.startDate)}}-{{gettimer(item.updateDate)}}
								</view>
							</view>
							<view class="professional">
								{{item.jobName}}
							</view>
							<view class="text">
								{{item.content}}
							</view>
						</view>
					</OnlineResume>
					<view class="u-lineop">

					</view>
					<OnlineResume :titleName="titleName[3]">
						<view class="work" v-for="item in it.userResumeProjectExperienceList" :key="item.projectExperienceId" @click="link2(item)">
							<view class="company flex justify-between align-center">
								<view class="name">
									{{item.projectName}}
								</view>
								<view class="date">
									{{gettimer(item.startDate)}}-{{gettimer(item.endDate)}}
								</view>
							</view>
							<view class="professional">
								{{item.projectIndustry}}
							</view>
							<view class="text">
								{{item.projectContent}}
							</view>
						</view>
					</OnlineResume>
					<view class="u-lineop">

					</view>
					<OnlineResume :titleName="titleName[4]">
						<view class="work" v-for="item in it.userResumeEducationExperienceList" :key="item.educationExperienceId" @click="link3(item)">
							<view class="company flex justify-between align-center">
								<view class="name">
									{{item.schoolName}}
								</view>
								<view class="date">
									{{gettimer(item.startDate)}}-{{gettimer(item.endDate)}}
								</view>
							</view>
							<text class="professional" style="margin-right: 20rpx;">
								{{school(item.schoolType)}}
							</text>
							<text class="text">
								{{item.schoolSpecialty}}
							</text>
						</view>
					</OnlineResume>
				</view>
			</scroll-view>
		</view>
		<!-- 附件简历 -->
		<view class="furesume">
			<view class="items flex align-center">
				<view class="icon">

				</view>
				<view class="title">
					我的附件简历
				</view>
			</view>
			<view class="link-att flex justify-between align-center">
				<view class="left flex align-center">
					<view class="img flex justify-center align-center">
						<image src="https://sanfuzhide.oss-cn-hangzhou.aliyuncs.com/my/activity2.png" mode="">
						</image>
					</view>
					<view class="name">
						附件简历
					</view>
				</view>
				<view class="right flex align-center" @click="link">
					<view class="add">
						添加附件简历
					</view>
					<view class="icon">
						<u-icon color="#999999" size="24" name="arrow-right"></u-icon>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		resume
	} from '@/data/my.js'
	import OnlineResume from '@/components/onlineResume/onlineResume.vue'
	export default {
		components: {
			OnlineResume
		},
		data() {
			return {
				tabbarTop: 0,
				resume,
				titleName: resume.titleName,
				item:{},
				it:{resumeAscendancy:''},
			}
		},
		onShow() {
			this.init()
		},
		methods: {
			//初始化
			async init() {
				await this._setTabbarTitleHeight()
				await this.getData()
				await this.getList()
			},
			//获取数据
			async getData() {
				let {data: item} = await this.$get('/userResumeList/userCastJaneInfo')
				this.item = item
			},
			//获取简历内容
			async getList() {
				let {data: item} = await this.$get('/userResumeList/userResume')
				this.it = item
				await console.log(item.userResumeEducationExperienceList)
			},
			//求职期望的删改
			link0(e) {
				uni.navigateTo({
					url: '/pagesB/userJianli/jobExpire?item=' + JSON.stringify(e)
				})
			},
			//工作经历删改
			link1(e) {
				uni.navigateTo({
					url: '/pagesB/userJianli/jobExperience?item=' + JSON.stringify(e)
				})
			},
			//项目经验删改
			link2(e) {
				uni.navigateTo({
					url: '/pagesB/userJianli/projectExperience?item=' + JSON.stringify(e)
				})
			},
			//教育经历更改
			link3(e) {
				uni.navigateTo({
					url: '/pagesB/userJianli/education?item=' + JSON.stringify(e)
				})
			},
			//前往投递信息列表页
			linklist(id){
				uni.navigateTo({
					url: '/pagesA/deliveryMsg/deliveryMsg?current=' + id
				})
			},
			//添加附件简历
			link(){
				uni.navigateTo({
					url: '/pagesA/attachment/attachment'
				})
			},
			//设置title高度
			_setTabbarTitleHeight() {
				let top = uni.getStorageSync('tabbarCapsule')
				this.tabbarTop = top.top + 'px'
			},
			//返回按钮
			back() {
				uni.navigateBack({
					delta: 0
				})
			},
			//转换时间戳格式
			gettimer(i){
				let oldtime = new Date(i);
				let t_day = oldtime.getDate()
				let t_year = oldtime.getFullYear();
				let t_month = oldtime.getMonth() + 1;
				return t_year + '.' + t_month + '.' +t_day
			},
			//学校等级
			school(id) {
				switch(id){
					case 0: return '中专'
					break;
					case 1: return '大专'
					break;
					case 2: return '本科'
					break;
					case 3: return '本科以上'
					break;
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.page {
		.tabbar {
			width: 750rpx;
			height: 290rpx;
			background: linear-gradient(135deg, #1C79F8, #0265EB);
			position: relative;

			.tabbar-title {

				.icon {
					width: 40rpx;
					height: 40rpx;
					margin-left: 20rpx;
				}

				.title {
					width: 100%;
					padding-right: 70rpx;
					font-size: 40rpx;
					color: #FFFFFF;
					font-weight: 600;
				}
			}

			.card {
				width: 690rpx;
				height: 227rpx;
				padding: 30rpx;
				background: #FFFFFF;
				box-shadow: 0rpx 0rpx 14rpx 0rpx rgba(98, 98, 98, 0.14);
				border-radius: 24rpx;
				position: absolute;
				left: 30rpx;
				bottom: -135rpx;

				.top {
					.icon {
						width: 4rpx;
						height: 29rpx;
						background: #0265EB;
						margin-right: 20rpx;
					}

					.name {
						font-weight: bold;
						color: #333333;
						font-size: 32rpx;
						line-height: 1;
					}
				}

				.item {
					padding: 0 60rpx 0 30rpx;
					margin-top: 40rpx;

					.child {
						.num {
							font-weight: bold;
							color: #333333;
							font-size: 32rpx;
						}

						.text {
							font-weight: 400;
							color: #333333;
							font-size: 24rpx;
						}
					}
				}

				.img {
					position: absolute;
					top: -24rpx;
					right: -10rpx;
					width: 127rpx;
					height: 132rpx;
				}
			}
		}

		.content {
			padding: 40rpx 30rpx;

			.resume {
				.items {
					.icon {
						width: 4rpx;
						height: 29rpx;
						background: #0265EB;
						margin-right: 20rpx;
					}

					.title {
						font-weight: bold;
						color: #333333;
						font-size: 32rpx;
					}
				}

				// 个人优势
				.con {
					margin-top: 20rpx;
					font-weight: 500;
					color: #333333;
					font-size: 28rpx;
				}

				// 求职期望
				.tree {
					margin-top: 20rpx;

					.top {
						font-weight: 500;
						color: #333333;
						font-size: 28rpx;
						line-height: 1;
						margin-top: 20rpx;

						.left {
							margin-right: 10rpx;
						}
					}

					.bot {
						font-weight: 500;
						color: #666666;
						font-size: 24rpx;
						line-height: 1;
						margin-top: 20rpx;

						.left {
							margin-right: 10rpx;
						}
					}
				}

				// 工作经历
				.work {
					.company {
						margin-top: 20rpx;

						.name {
							font-weight: 500;
							color: #333333;
							font-size: 28rpx;
						}

						.date {
							font-weight: 500;
							color: #999999;
							font-size: 24rpx;
						}
					}

					.professional {
						font-weight: 500;
						color: #666666;
						font-size: 24rpx;
						margin-top: 20rpx;
					}

					.text {
						font-weight: 500;
						color: #666666;
						font-size: 24rpx;
						margin-top: 20rpx;
					}
				}
			}
		}

		.furesume {
			background: #FFFFFF;
			height: 120rpx;
			position: fixed;
			left: 30rpx;
			bottom: calc(20rpx + env(safe-area-inset-bottom));

			// 附件简历样式
			.items {
				.icon {
					width: 4rpx;
					height: 29rpx;
					background: #0265EB;
					margin-right: 20rpx;
				}

				.title {
					font-weight: bold;
					color: #333333;
					font-size: 32rpx;
				}
			}

			.link-att {
				width: 690rpx;
				margin-top: 30rpx;

				.left {
					.img {
						width: 28rpx;
						height: 24rpx;
						margin-right: 16rpx;
					}

					.name {
						font-weight: bold;
						color: #333333;
						font-size: 24rpx;
					}
				}

				.right {
					.add {
						font-weight: 400;
						color: #999999;
						font-size: 24rpx;
						margin-right: 20rpx;
					}
				}
			}
		}
	}
</style>
